package com.yikome.delivery.enums;

/**
 * 已创建(0) | 已派单(10) | 已发货(20) | 已签收(30) | 已拒收(-20) | 已取消(-10)  
 */
public enum DeliveryStatus {

	DELIVERY_CREATED(0 , "已创建") , 
	
	DELIVERY_ASYNC(10 , "已派单") , 
	
	DELIVERY_SEND(20 , "已发货") , 
	
	DELIVERY_RECEPTED(30 , "签收"),
	
	DELIVERY_REJECT(-20 , "拒收"),
	
	DELIVERY_CANCEL(-10 , "取消");
	
	
	private int status ; 
	private String statusName ;
	
	private DeliveryStatus (int status , String statusName) {
		this.status = status; 
		this.statusName = statusName;
	}

	public int getStatus() {
		return status;
	}

	public String getStatusName() {
		return statusName;
	}
	
	public static DeliveryStatus name(int status) {
		DeliveryStatus[] enums = DeliveryStatus.values();
		for (DeliveryStatus _enum : enums) {
			if(_enum.getStatus() == status) {
				return _enum;
			}
		}
		return null;
	}
}
